package com.jsbj.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;

@Getter
@AllArgsConstructor
public enum CompositePushTypeEnum {
//    PROGRESS_PLAN_MONTH("","PROGRESS_PLAN_MONTH", "进度计划-月"),
//    PROGRESS_PLAN_QUARTER("","PROGRESS_PLAN_QUARTER", "进度计划-季度"),
//    PROGRESS_PLAN_YEAR("","PROGRESS_PLAN_YEAR", "进度计划-年"),
//    PROGRESS_MONTH_FILL("","PROGRESS_MONTH_FILL", "月进度填报"),
    DOC_MANAGE("TZTS","DOC_MANAGE", "文档管理通知", "todo/xxts.png"),
    ANNOUNCEMENT_MANAGE("TZTS","ANNOUNCEMENT_MANAGE", "通知公告通知", "todo/xxts.png"),
    MEETING_MANAGE("TZTS","MEETING_MANAGE", "项目会议通知", "todo/xxts.png"),
    SCHEDULE_PLAN("JHBZ", "SCHEDULE_PLAN", "进度管理-计划编制", "todo/jhbz.png"),
    SCHEDULE_PLAN_CHANGE("JHBG", "SCHEDULE_PLAN_CHANGE", "进度管理-计划编制变更", "todo/jhbg.png"),
    SCHEDULE_ACTUAL("YJDTB", "SCHEDULE_ACTUAL", "进度管理-月进度填报", "todo/yjdtb.png"),
    SCHEDULE_PLAN_BH("TZTS","SCHEDULE_PLAN_BH", "进度管理-计划编制驳回", "todo/xxts.png"),
    SCHEDULE_PLAN_CHANGE_BH("TZTS","SCHEDULE_PLAN_CHANGE_BH", "进度管理-计划编制变更驳回", "todo/xxts.png"),
    SCHEDULE_ACTUAL_BH("TZTS","SCHEDULE_ACTUAL_BH", "进度管理-月进度填报驳回", "todo/xxts.png"),
    WBS_PROCEDURE("GXBY", "WBS_PROCEDURE", "工序-报验", ""),
    WBS_PROCEDURE_BH("TZTS","WBS_PROCEDURE_BH", "工序-驳回", "")
    ;

    private String menuCode;
    private String pushType;
    private String moduleDesc;
    private String modulePath;

    /**
     * 根据菜单编码获取推送类型
     * @param menuCode 值
     * @return 名称集合
     */
    public static List<String> getPushTypeByMenuCode(String menuCode)
    {
        List<String> pushTypeList = new ArrayList<>();
        if (menuCode == null)
        {
            return null;
        }

        for (CompositePushTypeEnum e : CompositePushTypeEnum.toEnumSet())
        {
            if (e.getMenuCode().equals(menuCode))
            {
                String that = e.getPushType();
                pushTypeList.add(that);
            }
        }
        return pushTypeList;
    }

    /**
     * 根据推送类型获取菜单编码
     * @param pushType 值
     * @return 名称集合
     */
    public static String getMenuCodeByPushType(String pushType)
    {
        String menuCode = "";

        for (CompositePushTypeEnum e : CompositePushTypeEnum.toEnumSet())
        {
            if (e.getPushType().equals(pushType))
            {
                menuCode = e.getMenuCode();
            }
        }
        return menuCode;
    }

    public static EnumSet<CompositePushTypeEnum> toEnumSet()
    {
        return EnumSet.allOf(CompositePushTypeEnum.class);
    }


}
